package net.minecraft.src;

import java.util.Random;
import net.minecraft.src.BaseMod;
import net.minecraft.src.Block;
import net.minecraft.src.CreativeTabs;
import net.minecraft.src.Item;
import net.minecraft.src.Material;
import net.minecraft.src.ModLoader;

public class mod_Part2 extends BaseMod {
	
	


	public String getVersion()
	{
		return "Version 1.0";
	}
)

	public static Block pyriteBlock = new Block(170, Material.rock).setUnlocalizedName("pyriteBlock").setCreativeTab(CreativeTabs.tabBlock).setHardness(3);
	public static Item spear = new ItemSpear(171, EnumToolMaterial.STONE).setUnlocalizedName("spear").setCreativeTab(CreativeTabs.tabCombat);
	public static Item chocoMilk = new ItemChocoMilk(173).setUnlocalizedName("chocolateMilk").setCreativeTab(CreativeTabs.tabFood);
	public static Block pyriteOre = new BlockPyriteOre(176).setUnlocalizedName("pyriteOre").setCreativeTab(CreativeTabs.tabBlock).setHardness(3);
	public static Item itemPyrite = new Item(177).setUnlocalizedName("pyrite").setCreativeTab(CreativeTabs.tabMaterials);
	public static Item pyriteMace = new ItemPyriteMace(178, EnumToolMaterial.GOLD).setUnlocalizedName("pyriteMace").setCreativeTab(CreativeTabs.tabCombat);
	public static Item shadowHelm = new ItemShadowHelm(179, (EnumArmorMaterial)EnumShadowArmorMaterial.SHADOW, ModLoader.addArmor("shadow"), 0).setUnlocalizedName("nightHelm").setCreativeTab(CreativeTabs.tabCombat);
	public static Item nightmareIngot = new Item(180).setUnlocalizedName("nightmareIngot").setCreativeTab(CreativeTabs.tabMaterials);
	public static Block nightmareOre = new BlockNightmareOre(181, Material.rock).setUnlocalizedName("nightmareOre").setCreativeTab(CreativeTabs.tabBlock).setHardness(7);
	

	public void load()
	{
		ModLoader.registerBlock(pyriteBlock);
		ModLoader.addName(pyriteBlock, "Pyrite");
		ModLoader.addRecipe(new ItemStack(this.pyriteBlock, 1), "aaa", "aaa", "aaa", 'a', itemPyrite);

		ModLoader.addName(spear, "Spear");
		ModLoader.addRecipe(new ItemStack(this.spear, 1), "b", "b", "b", 'a', Item.flint, 'b', Item.stick);

		ModLoader.addName(chocoMilk, "Chocolate Milk");
		ModLoader.addRecipe(new ItemStack(this.chocoMilk, 1), "aba", 'a', new ItemStack(Item.dyePowder, 1, 3), 'b', Item.bucketMilk);

		ModLoader.addName(pyriteOre, "Pyrite Ore");
		ModLoader.registerBlock(pyriteOre);

		ModLoader.addName(itemPyrite, "Pyrite");

		ModLoader.addName(pyriteMace, "Pyrite Mace");
		ItemStack stack = new ItemStack(this.pyriteMace, 1);
		stack.addEnchantment(Enchantment.knockback, 3);
		ModLoader.addRecipe(stack, "a", "b", "b", 'a', this.pyriteBlock, 'b', Item.stick);
		
		ModLoader.addName(shadowHelm, "Helmet of Shadows");
		ModLoader.addRecipe(new ItemStack(this.shadowHelm,1), "aaa", "a a", 'a', nightmareIngot);

		
		ModLoader.addName(nightmareIngot, "Nightmare Ingot");
		ModLoader.addSmelting(nightmareOre.blockID, new ItemStack(nightmareIngot), 1);
		
		ModLoader.addName(nightmareOre, "Nightmare Ore");
		ModLoader.registerBlock(nightmareOre);
		
	}
	public void generateSurface(World world, Random random, int i, int j)
	{
		for(int k = 0; k < 8; k++)
		{
			int randPosX = i + random.nextInt(16);
			int randPosY = random.nextInt(30);
			int randPosZ = j + random.nextInt(16);
			(new WorldGenMinable(pyriteOre.blockID, 4)).generate(world, random, randPosX, randPosY, randPosZ);
		}
		for(int k = 0; k < 5; k++)
		{
			int randPosX = i + random.nextInt(16);
			int randPosY = random.nextInt(25);
			int randPosZ = j + random.nextInt(16);
			(new WorldGenMinable(nightmareOre.blockID, 5)).generate(world, random, randPosX, randPosY, randPosZ);
		} 
	}
	

}